package cn.aiyuan.entity.account;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 账户表(Account)实体类
 *
 * @author 痴
 * @since 2020-04-28 10:39:07
 */
@Data
@ApiModel(value = "AccountDO", description = "账户表")
@TableName("account")
public class Account implements Serializable {

	private static final long serialVersionUID = -34226068042562243L;

	@ApiModelProperty(value = "id")
	private Long id;

	@ApiModelProperty(name = "acc", value = "账号")
	@JsonProperty("acc")
	private String account;

	@ApiModelProperty(name = "nick", value = "用户昵称")
	@JsonProperty("nick")
	private String nickName;

	@ApiModelProperty(name = "mail", value = "邮箱")
	@JsonProperty("mail")
	private String email;

	@ApiModelProperty(name = "number", value = "手机号码")
	@JsonProperty("number")
	private String phone;

	@ApiModelProperty(name = "pwd", value = "密码")
	@JsonProperty(value = "pwd", access = JsonProperty.Access.WRITE_ONLY)
	private String encryptedPassword;

	/**
	 * 密码盐
	 */
	@JsonIgnore
	private String salt;

	@ApiModelProperty(name = "init", value = "是否锁定账户,禁止删除,修改  ")
	@JsonProperty("init")
	private Boolean initial;

	/**
	 * 是否删除  0:未删除 1:已删除
	 */
	@JsonIgnore
	private Boolean deleted;

	@ApiModelProperty(name = "ena", value = "是否启用 true 启用 false 禁用")
	@JsonProperty("ena")
	private Boolean enable;

	@ApiModelProperty(name = "crTime", value = "创建时间", hidden = true)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JsonProperty(value = "crTime")
	private Timestamp createTime;

	@ApiModelProperty(name = "crId", value = "创建人", hidden = true)
	@JsonProperty(value = "crId")
	private Long createId;

	@ApiModelProperty(name = "upTime", value = "修改时间", hidden = true)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@JsonProperty(value = "upTime")
	private Timestamp updateTime;

	@ApiModelProperty(name = "upId", value = "修改人", hidden = true)
	@JsonProperty(value = "upId")
	private Long updateId;


}
